﻿
@if (Model.MainState == EditState.Preview)
{
    <CnGalWebSite.Shared.MasaComponent.Shared.Editors.Buttons.RevokeButton Url="@("/tags/EditMain/" + Model.Id)" ExamineType="Operation.EditTagMain" OnClickRevoke="OnRevoke" Class="ms-4 me-4 pt-4" />
}
<CnGalWebSite.Shared.MasaComponent.Shared.MaterialDesigns.MDMainInfoCard Name="@Model.Name" Image="@Model.MainPicture"
                                                                         BriefIntroduction="@Model.BriefIntroduction" Small="ForceSmall">
    <ButtonContent>
        @if (HiddenButton == false)
        {
            <CnGalWebSite.Components.Containers.MiniModeContainer>
                <div class="mt-2" style="display: flex; justify-content: flex-end;">
                    <CnGalWebSite.Shared.MasaComponent.Shared.Buttons.FavoriteButton Id="Model.Id" Type="FavoriteObjectType.Tag" Class="me-4" />
                    <CnGalWebSite.Shared.MasaComponent.Shared.Editors.Buttons.EditButton Type="ExaminedNormalListModelType.Tag" Id="Model.Id" @bind-IsHidden="@Model.IsHidden" @bind-IsEdit="@Model.IsEdit" />
                </div>
                @if (ToolHelper.IsMaui)
                {
                    <CnGalWebSite.Shared.MasaComponent.Shared.Buttons.ShareButton Title="@("标签 - "+Model.Name)" Class="ms-4" Text="@($"【标签】《{Model.Name}》\n{Model.BriefIntroduction}")" />
                }
            </CnGalWebSite.Components.Containers.MiniModeContainer>
        }

    </ButtonContent>
</CnGalWebSite.Shared.MasaComponent.Shared.MaterialDesigns.MDMainInfoCard>
@code {
    [Parameter]
    public TagIndexViewModel Model { get; set; }
    [Parameter]
    public bool HiddenButton { get; set; }
    [Parameter]
    public bool ForceSmall { get; set; }

    [Parameter]
    public EventCallback<Operation> OnRevoke { get; set; }
}
